<template>
	<view class="three-detail-page page">
		<view class="form-block block">
			<view class="form-item">
				<view class="form-label"><text class="require">*</text>{{label}}</view>
				<textarea class="textarea" placeholder-class="input-placeholder" :placeholder="placeholder"></textarea>
			</view>
			<!-- <view class="form-item">
				<view class="form-label">图片上传</view>
				<view class="upload-btn"></view>
			</view> -->
		</view>
		<view class="btn normal" @click="submit">提交</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				type:'1',
			}
		},
		computed:{
			label(){
				return this.getLabel()
			},
			placeholder(){
				switch(this.type){
					case '1':
						return '对于码上就业，您有哪些宝贵意见'
					case '2':
						return '您是否遇到了欠薪等劳动保障问题'
					case '3':
						return '您有哪些急难愁盼问题需要我们解决'
					case '4':
						return '您对我们就业服务工作还有哪些不满意'
					default:
						return ''
				}
			}
		},
		methods:{
			submit(){
				this.showToast('提交成功',()=>{
					this.back()
				})
			},
			getLabel(){
				switch(this.type){
					case '1':
						return '意见建议'
					case '2':
						return '投诉举报'
					case '3':
						return '急难愁盼'
					case '4':
						return '干部作风'
				}
			}
		},
		onLoad(e) {
			this.type=e.type
			uni.setNavigationBarTitle({
				title:this.getLabel()
			})
		}
	}
</script>

<style lang="scss" scoped>
	.three-detail-page{
		padding: 30rpx;
		.form-block{
			width: 100%;
			padding: 30rpx;
			background: #fff;
			border-radius: 12px;
			.form-item{
				margin-bottom: 30rpx;
				.form-label{
					margin-bottom: 30rpx;
					.require{
						color: red;
					}
				}
				.textarea{
					width: 100%;
					border: 1px solid #dddddd;
					border-radius: 12px;
					padding: 20rpx;
				}
				.upload-btn{
					width:calc(50% - 10rpx);
					margin-right: 20rpx;
					border-radius: 12px;
					height: 200rpx;
					background:#f5f6f8 url('@/static/index/upload.png') no-repeat center;
					background-size: auto 50%;
				}
			}
		}
		.btn{
			margin: 30rpx auto;
		}
	}
</style>